package com.xx.chb01.web.controller;

import com.alibaba.fastjson.JSONObject;
import com.xx.chb01.common.bean.ResultEntity;
import com.xx.chb01.web.entity.student.Student;
import com.xx.chb01.web.mapper.StudentMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Auther: chb
 * @Date: 2018/12/12 22:14
 * @Description:
 */
@RestController
@RequestMapping("/api")
public class HelloController {

    @Resource
    private StudentMapper studentMapper;


    @RequestMapping(value = "/hello")
    public ResultEntity<String> hello() {
        List<Student> userList = studentMapper.selectList(null);
        String s=JSONObject.toJSONString(userList);
        return ResultEntity.success(s,0);
    }
}
